<template>
    <div>
        <transition name="component-fade-opacity" mode="out-in">
            <keep-alive :include="['list']">
                <component :is="page" :_id="_id" isMobanEdit @change="change"></component>
            </keep-alive>
        </transition>
    </div>
</template>

<script>
export default {
    components: {
        list: () => import('./list'),
        edit: () => import('@/views/admin/bn/moban/edit.vue'),
    },
    data() {
        return {
            page: 'list',
            _id: '',
        }
    },
    created() {
        this._id = this.$route.query._id
        if(this._id){
            this.page = 'edit'
        }
    },
    methods: {
        change({ page, _id }) {
            if(_id){
                this.updateUrl('_id',_id)
            }
            this.page = page
            this._id = _id
           
        },
    },
}
</script>

<style lang="scss" scoped></style>
